
import axios from 'axios'
import { defineStore } from 'pinia'

export const useChannelStore = defineStore('channel', () => {
    interface Channel {
        id: number,
        name: string
    }
    const channellist = ref<Channel[]>([])
    const getchannellist= async () => {
        console.log(7744);
        
       const res= await axios.get('http://geek.itheima.net/v1_0/channels');
       console.log(res);
       channellist.value=res.data.data.channels;
        
    }
    
    return { channellist, getchannellist }
})